﻿using System;
using System.Collections.Generic;
using System.Text;

namespace TST.SharePointObjects.ContentWebParts
{
    // Tag Cloud based on the tag cloud web part in the Community Kit for SharePoint
    // http://www.codeplex.com/CKS
    static class TagHelper
    {

        public static int GetTagWeight(int Count, int MaxCount)
        {
            double Percent = (double)((Count * 100) / MaxCount);

            if (Percent > 90)
            {
                return 1;
            }
            else if (Percent > 70)
            {
                return 2;
            }
            else if (Percent > 50)
            {
                return 3;
            }
            else if (Percent > 30)
            {
                return 4;
            }
            else if (Percent > 10)
            {
                return 5;
            }
            else
            {
                return 6;
            }
        }



    }
}
